package com.network.topo.conf;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.springframework.beans.BeansException;

import com.network.util.FilePathUtil;
import com.network.util.SpringUtil;



public class SystemConfOnLoad {

	public static final int ReturnGuiMsgType=23201;
	public static final int socketTimeOut=5*60*1000;
	
	public static final int updateSocketTimeOut=30*1000;

	public static void confOnLoad() {
		try {
			String xmlFile = FilePathUtil.getRootPath() + "conf/topoconf.xml";

			SpringUtil.init(xmlFile);
		} catch (BeansException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static Object getObject(String beanId) throws BeansException {
	
		return SpringUtil.getObject(beanId);
	}
	
	public static SNMPConf getSNMPConf() throws BeansException {
		
		return (SNMPConf)SpringUtil.getObject("snmpconf");
	}

}
